<template>
  <div>
    <mt-header title="工单进度">
      <mt-button slot="left" icon="back" @click="goback()"></mt-button>
      <mt-button slot="right" @click="">提交</mt-button>
    </mt-header>

    <div>
      <span class="left">工单编号：</span>
      <span class="right" v-bind="fgdno">{{fgdno}}</span>
    </div>
    <div>
      <span class="left">设备：</span>
      <span class="right" v-bind="fsbname">{{fsbname}}</span>
    </div>
    <div>
      <span class="left">机构：</span>
      <span class="right" v-bind="fsbjgname">{{fsbjgname}}</span>
    </div>
    <div>
      <span class="left">子机构：</span>
      <span class="right" v-bind="fsbzjgname">{{fsbzjgname}}</span>
    </div>
    <div>
      <span class="left">部件：</span>
      <span class="right" v-bind="fsbbjname">{{fsbbjname}}</span>
    </div>
    <div>
      <span class="left">原件：</span>
      <span class="right" v-bind="fsbyjname">{{fsbyjname}}</span>
    </div>
    <div>
      <span class="left">问题描述：</span>
      <span class="right" v-bind="fnote">{{fnote}}</span>
    </div>
    <div>
      <span class="left">完工状态：</span>
      <div class="right">
        <label v-for="option in wcoptions" style="font-size: small">
          <input name="fstate" type="radio" :value="option.value" v-model="fwg_flag">{{option.name}}</label>
        <!--<label style="font-size: small"><input name="fstate" type="radio" value="0">未完工</label>-->
        <!--<label style="font-size: small"><input name="fstate" type="radio" value="1"/>已完工</label>-->
        <!--<label style="font-size: small"><input name="fstate" type="radio" value="2"/>暂停工单</label>-->
      </div>
    </div>
    <div>
      <span class="left">实际开始时间：</span>
      <mt-field class="right" type="date" v-model="fstrdate_sj"/>
    </div>
    <div>
      <span class="left">实际结束时间：</span>
      <mt-field class="right" type="date" v-model="fenddate_sj"/>
    </div>
    <div>
      <span class="left">未完成原因：</span>
      <mt-field class="right" type="text" v-model="fwwgnote"/>
    </div>
    <div>
      <span class="left">未完成原因：</span>
      <input type="text" v-model="fwwgnote"/>
    </div>
  </div>
</template>

<script>

  export default {
    name: "EditSchedulePage",
    created() {
      this.getScheduleDetail();
    },
    data() {
      return {
        fwg_flag:0,
//      fgdno:"",
        fstate: "",
//fnote:"",
        fstrdate: "",
        fenddate: "",
        fys: "",
        fczr: "",
        //上面是录入用的
        fid: "",
        fgdno: "",
        fqfdept: "",
        dept_name: "",
        fqfuser: "",
        fryxm: "",
        fsbcode: "",
        fsbname: "",
        fsbjg: "",
        fsbjgname: "",
        fsbzjg: "",
        fsbzjgname: "",
        fsbbj: "",
        fsbbjname: "",
        fuserid: "",
        fnote: "",
        filename: "",
        fsbyjname: "",
        fsbyj: "",
        fwxfzr: "",
        fwxfzr_tel: "",
        fwxry: "",
        fstrdate_sj: "",
        fenddate_sj: "",
        fwwgnote: "",
        msg: "",
        wcoptions: [{name: '未完工', value: 0}
          , {name: '已完工', value: 1}
          , {name: '暂停工单', value: 2}]
      }
    },
    methods: {
      getScheduleDetail() {
        var that = this;
        var params = new Object();
        var url = global.BASE_URL + '/Schedule/getScheduleDetail';
        // params.fgdno = that.$route.params.fgdno;
        params.fgdno = 'GMJ201810250001'
        this.$http({
          method: 'GET',
          url: url,
          params: params,
        }).then(function (responce) {
          var response1 = responce.data;
          var errorCode = response1.errorCode;
          var errorMessage = response1.errorMessage;
          that.fgdno = response1.data.fgdno;
          that.fsbname = response1.data.fsbname;
          that.fsbjgname = response1.data.fsbjgname;
          that.fsbzjgname = response1.data.fsbzjgname;
          that.fsbbjname = response1.data.fsbbjname;
          that.fnote = response1.data.fnote;
          that.filename = response1.data.filename;
          that.fsbyjname = response1.data.fsbyjname;
          that.fsbyj = response1.data.fsbyj;
        }).catch(function (error) {
          console.log(error)
        })
      },
      goback() {
        this.$router.go(-1)
      },
      getInsert() {

//fgdno
//fstate
//fnote
//fstrdate
//fenddate
//fys
//fczr
      },
      getUpdate() {
        var that = this;
        var params = new Object();
        var url = global.BASE_URL + '/Schedule/updateWg';
        // params.fgdno = that.$route.params.fgdno;
        params.fgdno = 'GMJ201810250001'
        params.fwg_flag=this.fwg_flag;
        params.fstrdate_sj=this.fstrdate_sj;
        params.fenddate_sj=this.fenddate_sj;
        this.$http({
          method: 'GET',
          url: url,
          params: params,
        }).then(function (responce) {
          var response1 = responce.data;
          var errorCode = response1.errorCode;
          var errorMessage = response1.errorMessage;
          var message=responce.data;
        }).catch(function (error) {
          console.log(error)
        })
      }
    }
  }
</script>

<style scoped>
  .left {
    width: 30%;
    height: auto;
    float: left;
    margin: 5px;
    text-align: right;
    line-height: 30px;
  }

  .right {
    width: 65%;
    height: 30px;
    float: left;
    margin: 5px;
    text-align: left;
    line-height: 30px;
    font-weight: bold;
    font-family: 黑体;
  }
  .edittext{

  }
</style>
